home *** CD-ROM | disk | FTP | other *** search
/ Aminet 1 (Walnut Creek) / Aminet - June 1993 [Walnut Creek].iso / aminet / util / gnu / fileutils_3_3.lha / fileutils-3.3 / configure < prev    next >
Text File  |  1992-08-01  |  19KB  |  856 lines

  1. #!/bin/sh
  2. # Guess values for system-dependent variables and create Makefiles.
  3. # Generated automatically using autoconf.
  4. # Copyright (C) 1991, 1992 Free Software Foundation, Inc.
  5.  
  6. # This program is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 2, or (at your option)
  9. # any later version.
  10.  
  11. # This program is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. # GNU General Public License for more details.
  15.  
  16. # You should have received a copy of the GNU General Public License
  17. # along with this program; if not, write to the Free Software
  18. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19.  
  20. # Usage: configure [--srcdir=DIR] [--host=HOST] [--gas] [--nfp] [--no-create]
  21. #        [--prefix=PREFIX] [--exec_prefix=PREFIX] [--with-PROGRAM] [TARGET]
  22. # Ignores all args except --srcdir, --prefix, --exec_prefix, and --no-create.
  23.  
  24. trap 'rm -f conftest* core; exit 1' 1 3 15
  25.  
  26. for arg
  27. do
  28.   # Handle --exec_prefix with a space before the argument.
  29.   if test x$next_exec_prefix = xyes; then exec_prefix=$arg; next_exec_prefix=
  30.   # Handle --host with a space before the argument.
  31.   elif test x$next_host = xyes; then next_host=
  32.   # Handle --prefix with a space before the argument.
  33.   elif test x$next_prefix = xyes; then prefix=$arg; next_prefix=
  34.   # Handle --srcdir with a space before the argument.
  35.   elif test x$next_srcdir = xyes; then srcdir=$arg; next_srcdir=
  36.   else
  37.     case $arg in
  38.      -exec_prefix=* | --exec_prefix=* | --exec_prefi=* | --exec_pref=* | --exec_pre=* | --exec_pr=* | --exec_p=* | --exec_=* | --exec=* | --exe=* | --ex=* | --e=*)
  39.     exec_prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  40.      -exec_prefix | --exec_prefix | --exec_prefi | --exec_pref | --exec_pre | --exec_pr | --exec_p | --exec_ | --exec | --exe | --ex | --e)
  41.     next_exec_prefix=yes ;;
  42.  
  43.      -gas | --gas | --ga | --g) ;;
  44.  
  45.      -host=* | --host=* | --hos=* | --ho=* | --h=*) ;;
  46.      -host | --host | --hos | --ho | --h)
  47.     next_host=yes ;;
  48.  
  49.      -nfp | --nfp | --nf) ;;
  50.  
  51.      -no-create | --no-create | --no-creat | --no-crea | --no-cre | --no-cr | --no-c | --no- | --no)
  52.         no_create=1 ;;
  53.  
  54.      -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
  55.     prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  56.      -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
  57.     next_prefix=yes ;;
  58.  
  59.      -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=* | --s=*)
  60.     srcdir=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  61.      -srcdir | --srcdir | --srcdi | --srcd | --src | --sr | --s)
  62.     next_srcdir=yes ;;
  63.  
  64.      -with-* | --with-*) ;;
  65.  
  66.      *) ;;
  67.     esac
  68.   fi
  69. done
  70.  
  71. rm -f conftest*
  72. compile='${CC-cc} $DEFS conftest.c -o conftest $LIBS >/dev/null 2>&1'
  73.  
  74. # A filename unique to this package, relative to the directory that
  75. # configure is in, which we can look for to find out if srcdir is correct.
  76. unique_file=src/ls.c
  77.  
  78. # Find the source files, if location was not specified.
  79. if test -z "$srcdir"; then
  80.   srcdirdefaulted=yes; srcdir=.
  81.   if test ! -r $unique_file; then srcdir=..; fi
  82. fi
  83. if test ! -r $srcdir/$unique_file; then
  84.   if test x$srcdirdefaulted = xyes; then
  85.     echo "configure: Can not find sources in \`.' or \`..'." 1>&2
  86.   else
  87.     echo "configure: Can not find sources in \`${srcdir}'." 1>&2
  88.   fi
  89.   exit 1
  90. fi
  91. # Preserve a srcdir of `.' to avoid automounter screwups with pwd.
  92. # But we can't avoid them for `..', to make subdirectories work.
  93. case $srcdir in
  94.   .|/*|~*) ;;
  95.   *) srcdir=`cd $srcdir; pwd` ;; # Make relative path absolute.
  96. esac
  97.  
  98. if test -z "$CC"; then
  99.   echo checking for gcc
  100.   saveifs="$IFS"; IFS="${IFS}:"
  101.   for dir in $PATH; do
  102.     test -z "$dir" && dir=.
  103.     if test -f $dir/gcc; then
  104.       CC="gcc"
  105.       break
  106.     fi
  107.   done
  108.   IFS="$saveifs"
  109. fi
  110. test -z "$CC" && CC="cc"
  111.  
  112. # Find out if we are using GNU C, under whatever name.
  113. cat <<EOF > conftest.c
  114. #ifdef __GNUC__
  115.   yes
  116. #endif
  117. EOF
  118. ${CC-cc} -E conftest.c > conftest.out 2>&1
  119. if egrep yes conftest.out >/dev/null 2>&1; then
  120.   GCC=1 # For later tests.
  121.   CC="$CC -O"
  122. fi
  123. rm -f conftest*
  124.  
  125. echo checking how to run the C preprocessor
  126. if test -z "$CPP"; then
  127.   CPP='${CC-cc} -E'
  128.   cat <<EOF > conftest.c
  129.  
  130. #include <stdio.h>
  131. EOF
  132. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  133. if test -z "$err"; then
  134.   :
  135. else
  136.   CPP=/lib/cpp
  137. fi
  138. rm -f conftest*
  139. fi
  140.  
  141. if test -n "$GCC"; then
  142.   echo checking whether -traditional is needed
  143.   pattern="Autoconf.*'x'"
  144.   prog='#include <sgtty.h>
  145. Autoconf TIOCGETP'
  146.   cat <<EOF > conftest.c
  147.  
  148. $prog
  149. EOF
  150. eval "$CPP $DEFS conftest.c > conftest.out 2>&1"
  151. if egrep "$pattern" conftest.out >/dev/null 2>&1; then
  152.   need_trad=1
  153. fi
  154. rm -f conftest*
  155.  
  156.  
  157.   if test -z "$need_trad"; then
  158.     prog='#include <termio.h>
  159. Autoconf TCGETA'
  160.     cat <<EOF > conftest.c
  161.  
  162. $prog
  163. EOF
  164. eval "$CPP $DEFS conftest.c > conftest.out 2>&1"
  165. if egrep "$pattern" conftest.out >/dev/null 2>&1; then
  166.   need_trad=1
  167. fi
  168. rm -f conftest*
  169.  
  170.   fi
  171.   test -n "$need_trad" && CC="$CC -traditional"
  172. fi
  173.  
  174. if test -z "$RANLIB"; then
  175.   echo checking for ranlib
  176.   saveifs="$IFS"; IFS="${IFS}:"
  177.   for dir in $PATH; do
  178.     test -z "$dir" && dir=.
  179.     if test -f $dir/ranlib; then
  180.       RANLIB="ranlib"
  181.       break
  182.     fi
  183.   done
  184.   IFS="$saveifs"
  185. fi
  186. test -z "$RANLIB" && RANLIB="@:"
  187.  
  188. echo checking for AIX
  189. cat <<EOF > conftest.c
  190.  
  191. #ifdef _AIX
  192.   yes
  193. #endif
  194.  
  195. EOF
  196. eval "$CPP $DEFS conftest.c > conftest.out 2>&1"
  197. if egrep "yes" conftest.out >/dev/null 2>&1; then
  198.   DEFS="$DEFS -D_ALL_SOURCE=1"
  199. fi
  200. rm -f conftest*
  201.  
  202.  
  203. echo checking for minix/config.h
  204. cat <<EOF > conftest.c
  205.  
  206. #include <minix/config.h>
  207. EOF
  208. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  209. if test -z "$err"; then
  210.   MINIX=1
  211. fi
  212. rm -f conftest*
  213.  
  214. # The Minix shell can't assign to the same variable on the same line!
  215. if test -n "$MINIX"; then
  216.   DEFS="$DEFS -D_POSIX_SOURCE=1"
  217.   DEFS="$DEFS -D_POSIX_1_SOURCE=2"
  218.   DEFS="$DEFS -D_MINIX=1"
  219. fi
  220.  
  221. echo checking for POSIXized ISC
  222. if test -d /etc/conf/kconfig.d &&
  223.   grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
  224. then
  225.   ISC=1 # If later tests want to check for ISC.
  226.   DEFS="$DEFS -D_POSIX_SOURCE=1"
  227.   if test -n "$GCC"; then
  228.     CC="$CC -posix"
  229.   else
  230.     CC="$CC -Xp"
  231.   fi
  232. fi
  233.  
  234. echo checking for limits.h
  235. cat <<EOF > conftest.c
  236.  
  237. #include <limits.h>
  238. EOF
  239. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  240. if test -z "$err"; then
  241.   DEFS="$DEFS -DHAVE_LIMITS_H=1"
  242. fi
  243. rm -f conftest*
  244.  
  245. echo checking for major, minor and makedev header
  246. echo "#include <sys/types.h>
  247. main() { exit(0); } t() { return makedev(0, 0); }" > conftest.c
  248. if eval $compile; then
  249.   makedev=1
  250. fi
  251. rm -f conftest*
  252.  
  253. if test -z "$makedev"; then
  254. echo checking for sys/mkdev.h
  255. cat <<EOF > conftest.c
  256.  
  257. #include <sys/mkdev.h>
  258. EOF
  259. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  260. if test -z "$err"; then
  261.   DEFS="$DEFS -DMAJOR_IN_MKDEV=1" makedev=1
  262. fi
  263. rm -f conftest*
  264.  
  265. fi
  266. if test -z "$makedev"; then
  267. echo checking for sys/sysmacros.h
  268. cat <<EOF > conftest.c
  269.  
  270. #include <sys/sysmacros.h>
  271. EOF
  272. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  273. if test -z "$err"; then
  274.   DEFS="$DEFS -DMAJOR_IN_SYSMACROS=1"
  275. fi
  276. rm -f conftest*
  277.  
  278. fi
  279.  
  280. echo checking for directory library header
  281. echo checking for dirent.h
  282. cat <<EOF > conftest.c
  283.  
  284. #include <dirent.h>
  285. EOF
  286. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  287. if test -z "$err"; then
  288.   DEFS="$DEFS -DDIRENT=1" dirheader=dirent.h
  289. fi
  290. rm -f conftest*
  291.  
  292. if test -z "$dirheader"; then
  293. echo checking for sys/ndir.h
  294. cat <<EOF > conftest.c
  295.  
  296. #include <sys/ndir.h>
  297. EOF
  298. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  299. if test -z "$err"; then
  300.   DEFS="$DEFS -DSYSNDIR=1" dirheader=sys/ndir.h
  301. fi
  302. rm -f conftest*
  303.  
  304. fi
  305. if test -z "$dirheader"; then
  306. echo checking for sys/dir.h
  307. cat <<EOF > conftest.c
  308.  
  309. #include <sys/dir.h>
  310. EOF
  311. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  312. if test -z "$err"; then
  313.   DEFS="$DEFS -DSYSDIR=1" dirheader=sys/dir.h
  314. fi
  315. rm -f conftest*
  316.  
  317. fi
  318.  
  319. echo checking for closedir return value
  320. cat <<EOF > conftest.c
  321. #include <sys/types.h>
  322. #include <$dirheader>
  323. int closedir(); main() { exit(0); }
  324. EOF
  325. eval $compile
  326. if test -s conftest && (./conftest 2>/dev/null) 2>/dev/null; then
  327.   :
  328. else
  329.   DEFS="$DEFS -DVOID_CLOSEDIR=1"
  330. fi
  331. rm -f conftest*
  332.  
  333. echo '#include <signal.h>' > conftest.c
  334. eval "$CPP $DEFS conftest.c > conftest.out 2>&1"
  335. if egrep "(void|sighandler_t).*signal" conftest.out >/dev/null 2>&1; then
  336.   :
  337. else 
  338.   DEFS="$DEFS -DRETSIGTYPE=int"
  339. fi
  340. rm -f conftest*
  341.  
  342.  
  343. echo checking how to get list of mounted filesystems
  344. # SVR4
  345. echo '#include <sys/mnttab.h>' > conftest.c
  346. eval "$CPP $DEFS conftest.c > conftest.out 2>&1"
  347. if egrep "putmntent" conftest.out >/dev/null 2>&1; then
  348.   DEFS="$DEFS -DMOUNTED_GETMNTENT2=1" mounted=1
  349. fi
  350. rm -f conftest*
  351.  
  352. if test -z "$mounted"; then
  353. # AIX.
  354. cat <<EOF > conftest.c
  355.  
  356. #include <fshelp.h>
  357. EOF
  358. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  359. if test -z "$err"; then
  360.   DEFS="$DEFS -DMOUNTED_VMOUNT=1" mounted=1
  361. fi
  362. rm -f conftest*
  363. fi
  364. if test -z "$mounted"; then
  365. # SVR3
  366. cat <<EOF > conftest.c
  367.  
  368. #include <sys/statfs.h>
  369. #include <sys/fstyp.h>
  370. #include <mnttab.h>
  371. EOF
  372. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  373. if test -z "$err"; then
  374.   DEFS="$DEFS -DMOUNTED_FREAD_FSTYP=1" mounted=1
  375. fi
  376. rm -f conftest*
  377. fi
  378. if test -z "$mounted"; then
  379. # 4.3BSD
  380. cat <<EOF > conftest.c
  381.  
  382. #include <mntent.h>
  383. EOF
  384. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  385. if test -z "$err"; then
  386.   DEFS="$DEFS -DMOUNTED_GETMNTENT1=1" mounted=1
  387. fi
  388. rm -f conftest*
  389. fi
  390. if test -z "$mounted"; then
  391. # 4.4BSD
  392. echo '#include <sys/mount.h>' > conftest.c
  393. eval "$CPP $DEFS conftest.c > conftest.out 2>&1"
  394. if egrep "MOUNT_UFS" conftest.out >/dev/null 2>&1; then
  395.   DEFS="$DEFS -DMOUNTED_GETMNTINFO=1" mounted=1
  396. fi
  397. rm -f conftest*
  398.  
  399. fi
  400. if test -z "$mounted"; then
  401. # Ultrix
  402. cat <<EOF > conftest.c
  403.  
  404. #include <sys/fs_types.h>
  405. #include <sys/mount.h>
  406. EOF
  407. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  408. if test -z "$err"; then
  409.   DEFS="$DEFS -DMOUNTED_GETMNT=1" mounted=1
  410. fi
  411. rm -f conftest*
  412. fi
  413. if test -z "$mounted"; then
  414. # SVR2
  415. cat <<EOF > conftest.c
  416.  
  417. #include <mnttab.h>
  418. EOF
  419. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  420. if test -z "$err"; then
  421.   DEFS="$DEFS -DMOUNTED_FREAD=1" mounted=1
  422. fi
  423. rm -f conftest*
  424. fi
  425.  
  426. echo checking how to get filesystem space usage
  427. # SVR4
  428. cat <<EOF > conftest.c
  429.  
  430. #include <sys/statvfs.h>
  431. EOF
  432. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  433. if test -z "$err"; then
  434.   DEFS="$DEFS -DSTAT_STATVFS=1" space=1
  435. fi
  436. rm -f conftest*
  437. if test -z "$space"; then
  438. # AIX
  439. echo '#include <sys/statfs.h>' > conftest.c
  440. eval "$CPP $DEFS conftest.c > conftest.out 2>&1"
  441. if egrep "f_nlsdirtype" conftest.out >/dev/null 2>&1; then
  442.   DEFS="$DEFS -DSTAT_STATFS2_BSIZE=1" space=1
  443. fi
  444. rm -f conftest*
  445.  
  446. fi
  447. if test -z "$space"; then
  448. # SVR3
  449. cat <<EOF > conftest.c
  450.  
  451. #include <sys/statfs.h>
  452. EOF
  453. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  454. if test -z "$err"; then
  455.   DEFS="$DEFS -DSTAT_STATFS4=1" space=1
  456. fi
  457. rm -f conftest*
  458. fi
  459. if test -z "$space"; then
  460. # 4.3BSD
  461. cat <<EOF > conftest.c
  462.  
  463. #include <sys/vfs.h>
  464. EOF
  465. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  466. if test -z "$err"; then
  467.   DEFS="$DEFS -DSTAT_STATFS2_BSIZE=1" space=1
  468. fi
  469. rm -f conftest*
  470. fi
  471. if test -z "$space"; then
  472. # 4.4BSD
  473. echo '#include <sys/mount.h>' > conftest.c
  474. eval "$CPP $DEFS conftest.c > conftest.out 2>&1"
  475. if egrep "MOUNT_UFS" conftest.out >/dev/null 2>&1; then
  476.   DEFS="$DEFS -DSTAT_STATFS2_FSIZE=1" space=1
  477. fi
  478. rm -f conftest*
  479.  
  480. fi
  481. if test -z "$space"; then
  482. # SVR2
  483. cat <<EOF > conftest.c
  484.  
  485. #include <sys/filsys.h>
  486. EOF
  487. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  488. if test -z "$err"; then
  489.   DEFS="$DEFS -DSTAT_READ=1" space=1
  490. fi
  491. rm -f conftest*
  492. fi
  493. if test -z "$space"; then
  494. # Ultrix
  495. cat <<EOF > conftest.c
  496.  
  497. #include <sys/mount.h>
  498. EOF
  499. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  500. if test -z "$err"; then
  501.   DEFS="$DEFS -DSTAT_STATFS2_FS_DATA=1" space=1
  502. fi
  503. rm -f conftest*
  504. fi
  505. if test -n "$mounted" && test -n "$space"; then
  506.   PROGS="$PROGS df" LIBOBJS="$LIBOBJS fsusage.o mountlist.o"
  507. fi
  508.  
  509. echo '#include <sys/types.h>' > conftest.c
  510. eval "$CPP $DEFS conftest.c > conftest.out 2>&1"
  511. if egrep "uid_t" conftest.out >/dev/null 2>&1; then
  512.   :
  513. else 
  514.   DEFS="$DEFS -Duid_t=int" DEFS="$DEFS -Dgid_t=int"
  515. fi
  516. rm -f conftest*
  517.  
  518. echo checking integer size
  519. cat <<EOF > conftest.c
  520. main() { exit(!(sizeof(long) > sizeof(int))); }
  521. EOF
  522. eval $compile
  523. if test -s conftest && (./conftest 2>/dev/null) 2>/dev/null; then
  524.   DEFS="$DEFS -DINT_16_BITS=1"
  525. fi
  526. rm -f conftest*
  527. echo checking for ANSI C header files
  528. cat <<EOF > conftest.c
  529.  
  530. #include <stdlib.h>
  531. #include <stdarg.h>
  532. #include <string.h>
  533. #include <limits.h>
  534. EOF
  535. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  536. if test -z "$err"; then
  537.   DEFS="$DEFS -DSTDC_HEADERS=1"
  538. fi
  539. rm -f conftest*
  540.  
  541. echo checking for unistd.h
  542. cat <<EOF > conftest.c
  543.  
  544. #include <unistd.h>
  545. EOF
  546. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  547. if test -z "$err"; then
  548.   DEFS="$DEFS -DHAVE_UNISTD_H=1"
  549. fi
  550. rm -f conftest*
  551.  
  552. echo checking for BSD string and memory functions
  553. echo "#include <strings.h>
  554. main() { exit(0); } t() { rindex(0, 0); bzero(0, 0); }" > conftest.c
  555. if eval $compile; then
  556.   :
  557. else
  558.   DEFS="$DEFS -DUSG=1"
  559. fi
  560. rm -f conftest*
  561.  
  562. for func in fnmatch mkdir mktime stpcpy strdup strstr rename
  563. do
  564. echo checking for ${func}
  565. echo "
  566. main() { exit(0); } t() { 
  567. /* Override any gcc2 internal prototype to avoid an error.  */
  568. extern char ${func}(); ${func}(); }" > conftest.c
  569. if eval $compile; then
  570.   :
  571. else
  572.   LIBOBJS="$LIBOBJS ${func}.o"
  573. fi
  574. rm -f conftest*
  575.  
  576. done
  577.  
  578. for func in strerror fchmod ftime mkfifo
  579. do
  580. trfrom='[a-z]' trto='[A-Z]'
  581. echo checking for ${func}
  582. echo "
  583. main() { exit(0); } t() { 
  584. /* Override any gcc2 internal prototype to avoid an error.  */
  585. extern char ${func}(); ${func}(); }" > conftest.c
  586. if eval $compile; then
  587.   DEFS="$DEFS -DHAVE_`echo $func|tr "$trfrom" "$trto"`=1"
  588. fi
  589. rm -f conftest*
  590. done
  591.  
  592. echo checking for ftruncate
  593. echo "
  594. main() { exit(0); } t() { ftruncate(); }" > conftest.c
  595. if eval $compile; then
  596.   DEFS="$DEFS -DHAVE_FTRUNCATE=1"
  597. else
  598.   ftruncate_missing=1
  599. fi
  600. rm -f conftest*
  601.  
  602. if test -n "$ftruncate_missing"; then
  603. echo checking for fcntl emulation of ftruncate
  604. echo "#include <sys/types.h>
  605. #include <fcntl.h>
  606. main() { exit(0); } t() { 
  607. #if !defined(F_CHSIZE) && !defined(F_FREESP)
  608. chsize();
  609. #endif
  610.  }" > conftest.c
  611. if eval $compile; then
  612.   DEFS="$DEFS -DHAVE_FTRUNCATE=1" LIBOBJS="$LIBOBJS ftruncate.o"
  613. fi
  614. rm -f conftest*
  615.  
  616. fi
  617.  
  618. case "$LIBOBJS" in
  619. *rename.o*)
  620.   LIBPROGS="$LIBPROGS mvdir"
  621.   DEFS="$DEFS -DMVDIR=\\\\\"\$(libdir)/mvdir\\\\\""
  622.   ;;
  623. esac
  624.  
  625. echo checking for vprintf
  626. echo "
  627. main() { exit(0); } t() { vprintf(); }" > conftest.c
  628. if eval $compile; then
  629.   DEFS="$DEFS -DHAVE_VPRINTF=1"
  630. else
  631.   vprintf_missing=1
  632. fi
  633. rm -f conftest*
  634.  
  635. if test -n "$vprintf_missing"; then
  636. echo checking for _doprnt
  637. echo "
  638. main() { exit(0); } t() { _doprnt(); }" > conftest.c
  639. if eval $compile; then
  640.   DEFS="$DEFS -DHAVE_DOPRNT=1"
  641. fi
  642. rm -f conftest*
  643.  
  644. fi
  645.  
  646. echo checking for alloca.h
  647. cat <<EOF > conftest.c
  648.  
  649. #include <alloca.h>
  650. EOF
  651. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  652. if test -z "$err"; then
  653.   DEFS="$DEFS -DHAVE_ALLOCA_H=1"
  654. fi
  655. rm -f conftest*
  656.  
  657. decl="#ifdef __GNUC__
  658. #define alloca __builtin_alloca
  659. #else
  660. #if HAVE_ALLOCA_H
  661. #include <alloca.h>
  662. #else
  663. #ifdef _AIX
  664.  #pragma alloca
  665. #else
  666. char *alloca ();
  667. #endif
  668. #endif
  669. #endif
  670. "
  671. echo checking for alloca
  672. echo "$decl
  673. main() { exit(0); } t() { char *p = (char *) alloca(1); }" > conftest.c
  674. if eval $compile; then
  675.   :
  676. else
  677.   alloca_missing=1
  678. fi
  679. rm -f conftest*
  680.  
  681. if test -n "$alloca_missing"; then
  682.   SAVELIBS="$LIBS"
  683.   # Maybe alloca is in a different library.
  684.   #if test -f /usr/ucblib/libucb.a; then
  685.     # Avoid the broken BSD compatibility library as much as possible.
  686.     #LIBS="$LIBS -L/usr/ucblib -lc -lucb" trylib=-lucb # SVR4
  687.   #el
  688.   if test -f /lib/libPW.a; then
  689.     LIBS="$LIBS -lPW" trylib=-lPW # SVR2 and SVR3
  690.   fi
  691.   if test -n "$trylib"; then
  692.     alloca_missing=
  693.     echo checking for alloca in $trylib
  694. echo "$decl
  695. main() { exit(0); } t() { char *p = (char *) alloca(1); }" > conftest.c
  696. if eval $compile; then
  697.   :
  698. else
  699.   alloca_missing=1
  700. fi
  701. rm -f conftest*
  702.  
  703.   fi
  704.   if test -n "$alloca_missing"; then
  705.     LIBS="$SAVELIBS" ALLOCA=alloca.o
  706.   fi
  707. fi
  708.  
  709. echo checking for st_blocks in struct stat
  710. echo "#include <sys/types.h>
  711. #include <sys/stat.h>
  712. main() { exit(0); } t() { struct stat s; s.st_blocks; }" > conftest.c
  713. if eval $compile; then
  714.   DEFS="$DEFS -DHAVE_ST_BLOCKS=1"
  715. else
  716.   LIBOBJS="$LIBOBJS fileblocks.o"
  717. fi
  718. rm -f conftest*
  719.  
  720. echo checking utime with null argument
  721. rm -f conftestdata; > conftestdata
  722. # Sequent interprets utime(file, 0) to mean use start of epoch.  Wrong.
  723. cat <<EOF > conftest.c
  724. #include <sys/types.h>
  725. #include <sys/stat.h>
  726. main() {
  727. struct stat s, t;
  728. exit(!(stat ("conftestdata", &s) == 0 && utime("conftestdata", (long *)0) == 0
  729. && stat("conftestdata", &t) == 0 && t.st_mtime >= s.st_mtime
  730. && t.st_mtime - s.st_mtime < 120));
  731. }
  732. EOF
  733. eval $compile
  734. if test -s conftest && (./conftest 2>/dev/null) 2>/dev/null; then
  735.   DEFS="$DEFS -DHAVE_UTIME_NULL=1"
  736. fi
  737. rm -f conftest*
  738. rm -f core
  739.  
  740. echo checking for Xenix
  741. cat <<EOF > conftest.c
  742.  
  743. #if defined(M_XENIX) && !defined(M_UNIX)
  744.   yes
  745. #endif
  746.  
  747. EOF
  748. eval "$CPP $DEFS conftest.c > conftest.out 2>&1"
  749. if egrep "yes" conftest.out >/dev/null 2>&1; then
  750.   XENIX=1
  751. fi
  752. rm -f conftest*
  753.  
  754. if test -n "$XENIX"; then
  755.   DEFS="$DEFS -DVOID_CLOSEDIR=1"
  756.   LIBS="$LIBS -lx"
  757.   case "$DEFS" in
  758.   *SYSNDIR*) ;;
  759.   *) LIBS="-ldir $LIBS" ;; # Make sure -ldir precedes any -lx.
  760.   esac
  761. fi
  762.  
  763. echo checking for IRIX libsun
  764. if test -f /usr/lib/libsun.a; then
  765.   LIBS="$LIBS -lsun"
  766. fi
  767.  
  768. echo checking for DYNIX/ptx libseq
  769. cat <<EOF > conftest.c
  770.  
  771. #if defined(_SEQUENT_)
  772.   yes
  773. #endif
  774.  
  775. EOF
  776. eval "$CPP $DEFS conftest.c > conftest.out 2>&1"
  777. if egrep "yes" conftest.out >/dev/null 2>&1; then
  778.   SEQUENT=1
  779. fi
  780. rm -f conftest*
  781.  
  782. test -n "$SEQUENT" && test -f /usr/lib/libseq.a &&
  783.   LIBS="$LIBS -lseq"
  784.  
  785. if test -n "$prefix"; then
  786.   test -z "$exec_prefix" && exec_prefix='$(prefix)'
  787.   prsub="s,^prefix[     ]*=.*$,prefix = $prefix,"
  788. fi
  789. if test -n "$exec_prefix"; then
  790.   prsub="$prsub
  791. s,^exec_prefix[     ]*=.*$,exec_prefix = $exec_prefix,"
  792. fi
  793.  
  794. trap 'rm -f config.status; exit 1' 1 3 15
  795. echo creating config.status
  796. rm -f config.status
  797. cat <<EOF > config.status
  798. #!/bin/sh
  799. # Generated automatically by configure.
  800. # Run this file to recreate the current configuration.
  801. # This directory was configured as follows:
  802. # $0 $*
  803.  
  804. case "\$1" in
  805.   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
  806.   exec /bin/sh $0 $* ;;
  807. esac
  808.  
  809. trap 'rm -f Makefile lib/Makefile src/Makefile man/Makefile; exit 1' 1 3 15
  810. PROGS='$PROGS'
  811. LIBPROGS='$LIBPROGS'
  812. CC='$CC'
  813. CPP='$CPP'
  814. RANLIB='$RANLIB'
  815. LIBOBJS='$LIBOBJS'
  816. ALLOCA='$ALLOCA'
  817. LIBS='$LIBS'
  818. srcdir='$srcdir'
  819. DEFS='$DEFS'
  820. prefix='$prefix'
  821. exec_prefix='$exec_prefix'
  822. prsub='$prsub'
  823. EOF
  824. cat <<\EOF >> config.status
  825.  
  826. top_srcdir=$srcdir
  827. for file in Makefile lib/Makefile src/Makefile man/Makefile; do
  828.   srcdir=$top_srcdir
  829.   # Remove last slash and all that follows it.  Not all systems have dirname.
  830.   dir=`echo $file|sed 's,/[^/][^/]*$,,'`
  831.   if test "$dir" != "$file"; then
  832.     test "$top_srcdir" != . && srcdir=$top_srcdir/$dir
  833.     test ! -d $dir && mkdir $dir
  834.   fi
  835.   echo creating $file
  836.   rm -f $file
  837.   echo "# Generated automatically from `basename $file`.in by configure." > $file
  838.   sed -e "
  839. $prsub
  840. s,@PROGS@,$PROGS,
  841. s,@LIBPROGS@,$LIBPROGS,
  842. s,@CC@,$CC,
  843. s,@CPP@,$CPP,
  844. s,@RANLIB@,$RANLIB,
  845. s,@LIBOBJS@,$LIBOBJS,
  846. s,@ALLOCA@,$ALLOCA,
  847. s,@LIBS@,$LIBS,
  848. s,@srcdir@,$srcdir,
  849. s,@DEFS@,$DEFS," $top_srcdir/${file}.in >> $file
  850. done
  851.  
  852. EOF
  853. chmod +x config.status
  854. test -n "$no_create" || ./config.status
  855.  
  856.